package gui;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextArea;

public class ConsoleReso extends JPanel{
	
	private static final long serialVersionUID = 1L;
	private JTextArea zoneText;
	private JButton buttonAdd;
	private ConsoleResoUI fenetre;
	
	public ConsoleReso(ConsoleResoUI f) {
		super(true);

		this.setLayout(new BorderLayout(10,10));
		this.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
		this.fenetre = f;
		
		this.buttonAdd = new JButton("Ajouter un processus");
		buttonAdd.addActionListener(fenetre);
		
		this.zoneText = new JTextArea();
		zoneText.setMaximumSize(new Dimension(240, 300));
		
		this.add(buttonAdd, BorderLayout.NORTH);
		this.add(zoneText, BorderLayout.CENTER);
	}
	
	public void affiche(String s) {
		
		this.zoneText.setText(this.zoneText.getText()+s+"\n");
	}
}
